// <copyright file="Example.cs" company="Alan Dean">
// The MIT License

// Copyright (c) 2008 Alan Dean

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// </copyright>
// <author>Alan Dean</author>
// <email>alan.dean@thoughtpad.net</email>

namespace Semantic.Rdf
{
    using System;
    using System.Diagnostics.CodeAnalysis;

    /// <summary>
    /// Provides example URIs.
    /// <para>Used for testing purposes.</para>
    /// <para>This class cannot be instantiated directly.</para>
    /// </summary>
    public static class Example
    {
        #region fields

        /// <summary>
        /// Stores the <see cref="M:Semantic.Rdf.Example.Com()"/> data.
        /// </summary>
        private static readonly IUriReference _com = new UriReference("http://example.com/");

        /// <summary>
        /// Stores the <see cref="M:Semantic.Rdf.Example.Com(System.String)"/> data.
        /// </summary>
        private static readonly Uri _comUri = new Uri("http://example.com/");

        /// <summary>
        /// Stores the <see cref="M:Semantic.Rdf.Example.Net()"/> data.
        /// </summary>
        private static readonly IUriReference _net = new UriReference("http://example.net/");

        /// <summary>
        /// Stores the <see cref="M:Semantic.Rdf.Example.Net(System.String)"/> data.
        /// </summary>
        private static readonly Uri _netUri = new Uri("http://example.net/");

        /// <summary>
        /// Stores the <see cref="M:Semantic.Rdf.Example.Org()"/> data.
        /// </summary>
        private static readonly IUriReference _org = new UriReference("http://example.org/");

        /// <summary>
        /// Stores the <see cref="M:Semantic.Rdf.Example.Org(System.String)"/> data.
        /// </summary>
        private static readonly Uri _orgUri = new Uri("http://example.org/");
        
        #endregion

        #region public static IUriReference Com()
        /// <summary>
        /// Returns a URI reference with the value of http://example.com/
        /// </summary>
        /// <returns>A instance of the <see cref="T:Semantic.Rdf.IUriReference"/> class.</returns>
        public static IUriReference Com()
        {
            return _com;
        }
        #endregion

        #region public static IUriReference Com(string)
        /// <summary>
        /// Returns a URI reference with a base URI of http://example.com/
        /// and the specified <paramref name="relativePath"/>.
        /// </summary>
        /// 
        /// <param name="relativePath">The relative URI to add to the base URI.</param>
        /// 
        /// <returns>A instance of the <see cref="T:Semantic.Rdf.IUriReference"/> class.</returns>
        [SuppressMessage("Microsoft.Usage", "CA2234:PassSystemUriObjectsInsteadOfStrings", Justification = "This is a deliberate design.")]
        public static IUriReference Com(string relativePath)
        {
            return new UriReference(_comUri, relativePath);
        }
        #endregion

        #region public static IUriReference Net()
        /// <summary>
        /// Returns a URI reference with the value of http://example.net/
        /// </summary>
        /// <returns>A instance of the <see cref="T:Semantic.Rdf.IUriReference"/> class.</returns>
        public static IUriReference Net()
        {
            return _net;
        }
        #endregion

        #region public static IUriReference Net(string)
        /// <summary>
        /// Returns a URI reference with a base URI of http://example.net/
        /// and the specified <paramref name="relativePath"/>.
        /// </summary>
        /// 
        /// <param name="relativePath">The relative URI to add to the base URI.</param>
        /// 
        /// <returns>A instance of the <see cref="T:Semantic.Rdf.IUriReference"/> class.</returns>
        [SuppressMessage("Microsoft.Usage", "CA2234:PassSystemUriObjectsInsteadOfStrings", Justification = "This is a deliberate design.")]
        public static IUriReference Net(string relativePath)
        {
            return new UriReference(_netUri, relativePath);
        }
        #endregion

        #region public static IUriReference Org()
        /// <summary>
        /// Returns a URI reference with the value of http://example.org/
        /// </summary>
        /// <returns>A instance of the <see cref="T:Semantic.Rdf.IUriReference"/> class.</returns>
        public static IUriReference Org()
        {
            return _org;
        }
        #endregion

        #region public static IUriReference Org(string)
        /// <summary>
        /// Returns a URI reference with a base URI of http://example.org/
        /// and the specified <paramref name="relativePath"/>.
        /// </summary>
        /// 
        /// <param name="relativePath">The relative URI to add to the base URI.</param>
        /// 
        /// <returns>A instance of the <see cref="T:Semantic.Rdf.IUriReference"/> class.</returns>
        [SuppressMessage("Microsoft.Usage", "CA2234:PassSystemUriObjectsInsteadOfStrings", Justification = "This is a deliberate design.")]
        public static IUriReference Org(string relativePath)
        {
            return new UriReference(_orgUri, relativePath);
        }
        #endregion
    }
}